
/*
//===============================================================================
//  Generated From - SQLite_CSharp_BusinessEntity.vbgen
//
//  The supporting base class SQLiteEntity is in the Architecture directory in "dOOdads".
//  
//  This object is 'abstract' which means you need to inherit from it to be able
//  to instantiate it.  This is very easilly done. You can override properties and
//  methods in your derived class, this allows you to regenerate this class at any
//  time and not worry about overwriting custom code. 
//
//  NEVER EDIT THIS FILE.
//
//  public class YourObject :  _YourObject
//  {
//
//  }
//
//===============================================================================
*/

// Generated by MyGeneration Version # (1.2.0.2)

using System;
using System.Data;
using Finisar.SQLite;
using System.Collections;
using System.Collections.Specialized;

using MyGeneration.dOOdads;

namespace KismetLogger
{
	public abstract class _OUIData : SQLiteEntity
	{
		public _OUIData()
		{
			this.QuerySource = "OUIData";
			this.MappingName = "OUIData";

		}	

		//=================================================================
		//  public Overrides void AddNew()
		//=================================================================
		//
		//=================================================================
		public override void AddNew()
		{
			base.AddNew();
		}
		
		public override void FlushData()
		{
			this._whereClause = null;
			this._aggregateClause = null;
			base.FlushData();
		}
		
		public override string GetAutoKeyColumns()
		{
			return "";
		}
		

		//=================================================================
		//  	public Function LoadAll() As Boolean
		//=================================================================
		//  Loads all of the records in the database, and sets the currentRow to the first row
		//=================================================================
		public bool LoadAll() 
		{
			return this.Query.Load();
		}
	
	
		//=================================================================
		// public Overridable Function LoadByPrimaryKey()  As Boolean
		//=================================================================
		//  Loads a single row of via the primary key
		//=================================================================
		public virtual bool LoadByPrimaryKey(string Oui)
		{
			this.Where.Oui.Value = Oui;
			
			return this.Query.Load();
		}
		
		
		#region Parameters
		protected class Parameters
		{
			
			public static SQLiteParameter Oui
			{
				get
				{
					return new SQLiteParameter("@Oui", DbType.String);

				}
			}
			
			public static SQLiteParameter Company_name
			{
				get
				{
					return new SQLiteParameter("@Company_name", DbType.String);

				}
			}
			
		}
		#endregion		
	
		#region ColumnNames
		public class ColumnNames
		{  
            public const string Oui = "oui";
            public const string Company_name = "company_name";

			static public string ToPropertyName(string columnName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[Oui] = _OUIData.PropertyNames.Oui;
					ht[Company_name] = _OUIData.PropertyNames.Company_name;

				}
				return (string)ht[columnName];
			}

			static private Hashtable ht = null;			 
		}
		#endregion
		
		#region PropertyNames
		public class PropertyNames
		{  
            public const string Oui = "Oui";
            public const string Company_name = "Company_name";

			static public string ToColumnName(string propertyName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[Oui] = _OUIData.ColumnNames.Oui;
					ht[Company_name] = _OUIData.ColumnNames.Company_name;

				}
				return (string)ht[propertyName];
			}

			static private Hashtable ht = null;			 
		}			 
		#endregion	

		#region StringPropertyNames
		public class StringPropertyNames
		{  
            public const string Oui = "s_Oui";
            public const string Company_name = "s_Company_name";

		}
		#endregion		
		
		#region Properties
	
		public virtual string Oui
	    {
			get
	        {
				return base.Getstring(ColumnNames.Oui);
			}
			set
	        {
				base.Setstring(ColumnNames.Oui, value);
			}
		}

		public virtual string Company_name
	    {
			get
	        {
				return base.Getstring(ColumnNames.Company_name);
			}
			set
	        {
				base.Setstring(ColumnNames.Company_name, value);
			}
		}


		#endregion
		
		#region String Properties
	
		public virtual string s_Oui
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Oui) ? string.Empty : base.GetstringAsString(ColumnNames.Oui);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Oui);
				else
					this.Oui = base.SetstringAsString(ColumnNames.Oui, value);
			}
		}

		public virtual string s_Company_name
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Company_name) ? string.Empty : base.GetstringAsString(ColumnNames.Company_name);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Company_name);
				else
					this.Company_name = base.SetstringAsString(ColumnNames.Company_name, value);
			}
		}


		#endregion		
	
		#region Where Clause
		public class WhereClause
		{
			public WhereClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffWhereParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffWhereParameter(this);
					}

					return _tearOff;
				}
			}

			#region WhereParameter TearOff's
			public class TearOffWhereParameter
			{
				public TearOffWhereParameter(WhereClause clause)
				{
					this._clause = clause;
				}
				
				
				public WhereParameter Oui
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Oui, Parameters.Oui);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Company_name
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Company_name, Parameters.Company_name);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}


				private WhereClause _clause;
			}
			#endregion
		
			public WhereParameter Oui
		    {
				get
		        {
					if(_Oui_W == null)
	        	    {
						_Oui_W = TearOff.Oui;
					}
					return _Oui_W;
				}
			}

			public WhereParameter Company_name
		    {
				get
		        {
					if(_Company_name_W == null)
	        	    {
						_Company_name_W = TearOff.Company_name;
					}
					return _Company_name_W;
				}
			}

			private WhereParameter _Oui_W = null;
			private WhereParameter _Company_name_W = null;

			public void WhereClauseReset()
			{
				_Oui_W = null;
				_Company_name_W = null;

				this._entity.Query.FlushWhereParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffWhereParameter _tearOff;
			
		}
	
		public WhereClause Where
		{
			get
			{
				if(_whereClause == null)
				{
					_whereClause = new WhereClause(this);
				}
		
				return _whereClause;
			}
		}
		
		private WhereClause _whereClause = null;	
		#endregion
		
		#region Aggregate Clause
		public class AggregateClause
		{
			public AggregateClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffAggregateParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffAggregateParameter(this);
					}

					return _tearOff;
				}
			}

			#region AggregateParameter TearOff's
			public class TearOffAggregateParameter
			{
				public TearOffAggregateParameter(AggregateClause clause)
				{
					this._clause = clause;
				}
				
				
				public AggregateParameter Oui
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Oui, Parameters.Oui);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Company_name
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Company_name, Parameters.Company_name);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}


				private AggregateClause _clause;
			}
			#endregion
		
			public AggregateParameter Oui
		    {
				get
		        {
					if(_Oui_W == null)
	        	    {
						_Oui_W = TearOff.Oui;
					}
					return _Oui_W;
				}
			}

			public AggregateParameter Company_name
		    {
				get
		        {
					if(_Company_name_W == null)
	        	    {
						_Company_name_W = TearOff.Company_name;
					}
					return _Company_name_W;
				}
			}

			private AggregateParameter _Oui_W = null;
			private AggregateParameter _Company_name_W = null;

			public void AggregateClauseReset()
			{
				_Oui_W = null;
				_Company_name_W = null;

				this._entity.Query.FlushAggregateParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffAggregateParameter _tearOff;
			
		}
	
		public AggregateClause Aggregate
		{
			get
			{
				if(_aggregateClause == null)
				{
					_aggregateClause = new AggregateClause(this);
				}
		
				return _aggregateClause;
			}
		}
		
		private AggregateClause _aggregateClause = null;	
		#endregion
	
			
		
		protected override IDbCommand GetInsertCommand()
		{
			SQLiteCommand cmd = new SQLiteCommand();
			cmd.CommandType = CommandType.Text;
			cmd.CommandText =
			@"INSERT INTO [OUIData]
			(
				[oui],
				[company_name]
			)
			VALUES
			(
				@oui,
				@company_name
			)";

			CreateParameters(cmd);
			return cmd;
		}
	
		protected override IDbCommand GetUpdateCommand()
		{
			SQLiteCommand cmd = new SQLiteCommand();
			cmd.CommandType = CommandType.Text;
			cmd.CommandText = 
			@"UPDATE [OUIData] SET 
				[company_name]=@company_name
			WHERE
				[oui]=@oui";

			CreateParameters(cmd);
			return cmd;
		}
	
		protected override IDbCommand GetDeleteCommand()
		{
			SQLiteCommand cmd = new SQLiteCommand();
			cmd.CommandType = CommandType.Text;
			cmd.CommandText =
			@"DELETE FROM [OUIData] 
			WHERE
				[oui]=@oui";

	
			SQLiteParameter p;
			p = cmd.Parameters.Add(Parameters.Oui);
			p.SourceColumn = ColumnNames.Oui;
			p.SourceVersion = DataRowVersion.Current;

  
			return cmd;
		}
		
		private IDbCommand CreateParameters(SQLiteCommand cmd)
		{
			SQLiteParameter p;
		
			p = cmd.Parameters.Add(Parameters.Oui);
			p.SourceColumn = ColumnNames.Oui;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Company_name);
			p.SourceColumn = ColumnNames.Company_name;
			p.SourceVersion = DataRowVersion.Current;


			return cmd;
		}		
		
	
	}
}
